{include file='header'/}
<body>
<div class="weadmin-nav">
			<span class="layui-breadcrumb">
       		 <a href="">首页</a><span lay-separator="">/</span>
        	<a href="">常规管理</a><span lay-separator="">/</span>
            <a><cite>个人资料</cite></a>
      </span>
    <a class="layui-btn layui-btn-sm" style="float:right;margin-top: 5px" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon">&#xe9aa;</i></a>
</div>
<div class="weadmin-body" >
    <form class="layui-form" action="javascript:;" onsubmit="return dosub(this)">
        <div class="layui-form-item">
            <label for="username" class="layui-form-label">
                <span class="we-red">*</span>登录名
            </label>
            <div class="layui-input-block">
                <input type="text" id="username" name="username" value="{$data.username}" lay-verify="required" autocomplete="off" class="layui-input readonly-bg" readonly="">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="email" class="layui-form-label"><span class="we-red">*</span>邮箱</label>
            <div class="layui-input-block">
                <input type="text" id="email" name="email" value="{$data.email}" autocomplete="off" class="layui-input" lay-verify="email">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="password2" class="layui-form-label">新密码</label>
            <div class="layui-input-block">
                <input type="password" id="password" name="password" placeholder="不修改密码请留空" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label for="nickname" class="layui-form-label">昵称</label>
            <div class="layui-input-block">
                <input type="text" id="nickname" name="nickname" value="{$data.nickname}" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">创建时间</label>
            <div class="layui-input-block">
                <input type="text" value="{$data.createtime}" autocomplete="off" class="layui-input readonly-bg" readonly>
            </div>
        </div>

        <input type="hidden" name="dosubmit" value="1">
        <input type="hidden" name="id" value="{$data.id}">
        <div class="layui-form-item">
            <label class="layui-form-label"></label>
            <button class="layui-btn"  lay-submit="" >确定</button>
        </div>
    </form>
</div>
</body>
{include file='footer'/}
<script>
    function dosub(obj) {
        $.ajax({
            type: 'POST',
            url: '{:url('update')}',
            data: $(obj).serialize(),
            dataType: "json",
            success: function (res) {
                if(res.status == 1){
                    layer.msg(res.msg, {
                        icon: 1,
                        time: 2000
                    }, function(){
                        parent.location.reload();
                    });
                }else{
                    layer.msg(res.msg);
                }
            }
        });
        return false;
    }
</script>